<?php /* Smarty version 2.6.22, created on 2009-05-25 16:18:41
         compiled from myAdmin/tableInfo.sm */ ?>
<div>Структура таблицы <b><?php echo $this->_tpl_vars['tableAlias']; ?>
</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
<span style="cursor:pointer" onclick="ajaz('page=deleteTable&table=<?php echo $_POST['table']; ?>
','Удалить таблицу?')"><img src="/js/images/delete.png">Удалить таблицу</span>
<br><select id='parent_id'><option value="0">&nbsp;</option><?php echo $this->_tpl_vars['table_select']; ?>
</select><input type="button" onclick=ajaz("page=changeParentTable&table=<?php echo $_POST['table']; ?>
&parent_id="+document.getElementById("parent_id").value) value="Сменить родителя" />
</div>
<table border="1" cellpadding="4" cellspacing="2" class="tableNew" width="800">
  <tr>
    <td align="center" width="40">&nbsp;</td>
    <td align="center" width="40"><b><?php echo $this->_tpl_vars['lg']['A_shortDescr']; ?>
</b></td>
    <td align="center" width="40"><b><?php echo $this->_tpl_vars['lg']['A_keyField']; ?>
</b></td>
    <td align="center" width="40"><b><?php echo $this->_tpl_vars['lg']['A_alias']; ?>
</b></td>
    <td align="center"><b><?php echo $this->_tpl_vars['lg']['A_fieldType']; ?>
</b></td>
    <td align="center"><b>Значение по умолчанию</b></td>
  </tr>
  <?php if ($this->_tpl_vars['fields']): ?>
  <?php $_from = $this->_tpl_vars['fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['ord'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['ord']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['item']):
        $this->_foreach['ord']['iteration']++;
?>
    <tr>
      <td align="center" >
        <?php if ($this->_foreach['ord']['iteration'] != 1): ?>
          <img border="0" style="cursor:pointer" onclick="alertOrder('<?php echo $this->_tpl_vars['item']['id']; ?>
','up')" src="/js/images/arrow_up.gif"/>
        <?php endif; ?>
        <?php if ($this->_foreach['ord']['iteration'] != count ( $this->_tpl_vars['fields'] )): ?>
          <img border="0" style="cursor:pointer" onclick="alertOrder('<?php echo $this->_tpl_vars['item']['id']; ?>
','down')" src="/js/images/arrow_down.gif"/>
        <?php endif; ?>
      </td>
      <td align="center" ><input type="checkbox" <?php if ($this->_tpl_vars['item']['ch']): ?>checked="checked" <?php endif; ?>onclick="ajaz('page=alertCheck&field=<?php echo $this->_tpl_vars['item']['id']; ?>
&table=<?php echo $_POST['table']; ?>
')" /> </td>
      <td align="center" ><input type="radio" <?php if ($this->_tpl_vars['item']['radio']): ?>checked="checked" <?php endif; ?>onclick="ajaz('page=alertRadio&field=<?php echo $this->_tpl_vars['item']['id']; ?>
&table=<?php echo $_POST['table']; ?>
')" /> </td>
      <td align="center" ><span style="cursor:help" title="Изменить алиас" onclick="alertAlias('<?php echo $this->_tpl_vars['item']['id']; ?>
','<?php echo $this->_tpl_vars['item']['alias']; ?>
')"><?php echo $this->_tpl_vars['item']['alias']; ?>
</span></td>
      <td align="left">
        <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/select.sm', 'smarty_include_vars' => array('forAdmin' => 1,'id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['type'],'items' => $this->_tpl_vars['fieldTypes'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php if ($this->_tpl_vars['item']['type'] == '6'): ?>
          <br><input type="checkbox" id="list<?php echo $this->_tpl_vars['item']['id']; ?>
" onclick="ajaz('page=alertCheckValue&table=<?php echo $_POST['table']; ?>
&id=<?php echo $this->_tpl_vars['item']['id']; ?>
&state='+this.checked)" <?php if ($this->_tpl_vars['item']['combovalue']): ?> checked="checked"<?php endif; ?>> Только значения<br>
          <br /> <?php echo $this->_tpl_vars['lg']['A_source']; ?>
<br /><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/selectCombo.sm', 'smarty_include_vars' => array('id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['comboId'],'items' => $this->_tpl_vars['comboTables'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
          <br /><?php echo $this->_tpl_vars['lf']['A_dependentField']; ?>
 <br /><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/selectCombo.sm', 'smarty_include_vars' => array('depend' => 1,'id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['depend'],'items' => $this->_tpl_vars['fields'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
          <br /><?php echo $this->_tpl_vars['lg']['A_psevdoDependentField']; ?>
 <br /><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/selectPsevdo.sm', 'smarty_include_vars' => array('id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['psevdo'],'items' => $this->_tpl_vars['comboTables'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['item']['type'] == '10'): ?>
          <br /><font color="#008000"><b>ON: </b></font><input id="ch1<?php echo $this->_tpl_vars['item']['id']; ?>
" type="text" value="<?php echo $this->_tpl_vars['item']['check1']; ?>
"/>
          <br /><font color="#800000"><b>OFF: </b></font><input id="ch0<?php echo $this->_tpl_vars['item']['id']; ?>
" type="text" value="<?php echo $this->_tpl_vars['item']['check0']; ?>
" />
          <br /><input style="width:40px" type="button" onclick="
          ajaz('page=alertCheckBox&table=<?php echo $_POST['table']; ?>
&id=<?php echo $this->_tpl_vars['item']['id']; ?>
&cn='+get_('ch0<?php echo $this->_tpl_vars['item']['id']; ?>
','v')+'&cy='+get_('ch1<?php echo $this->_tpl_vars['item']['id']; ?>
','v'));
          " value="<?php echo $this->_tpl_vars['lg']['A_saveChanges']; ?>
"/>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['item']['type'] == '9'): ?>
          <br /><?php echo $this->_tpl_vars['lg']['A_source']; ?>
 <br /><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/selectCombo.sm', 'smarty_include_vars' => array('id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['comboId'],'items' => $this->_tpl_vars['comboTables'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['item']['type'] == '7'): ?>
          <br />/images/<?php echo $this->_tpl_vars['lg']['A_imageFolder']; ?>
 <input style="width:80px" type="text" value="<?php echo $this->_tpl_vars['item']['dest']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
dest" maxlength="20" />
          <br /><?php echo $this->_tpl_vars['lg']['A_imageWidth']; ?>
<input style="width:40px" type="text" value="<?php echo $this->_tpl_vars['item']['width']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
w" maxlength="4" />
          <br /><?php echo $this->_tpl_vars['lg']['A_imageHeight']; ?>
 <input style="width:40px" type="text" value="<?php echo $this->_tpl_vars['item']['height']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
h" maxlength="4" />
          <br /><?php echo $this->_tpl_vars['lg']['A_imageWidthTh']; ?>
 <input style="width:40px" type="text" value="<?php echo $this->_tpl_vars['item']['widthth']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
wth" maxlength="4" />
          <br /><?php echo $this->_tpl_vars['lg']['A_imageHeightTh']; ?>
 <input style="width:40px" type="text" value="<?php echo $this->_tpl_vars['item']['heightth']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
hth" maxlength="4" />
          <br /><?php echo $this->_tpl_vars['lg']['A_imagePrefix']; ?>
 <input style="width:40px" type="text" value="<?php echo $this->_tpl_vars['item']['prefix']; ?>
" id="<?php echo $this->_tpl_vars['item']['id']; ?>
prefix" maxlength="5" />
          <br /><input style="width:40px" type="button" onclick="alertSize('<?php echo $this->_tpl_vars['item']['id']; ?>
')" value="<?php echo $this->_tpl_vars['lg']['A_saveChanges']; ?>
"/>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['item']['type'] == '11'): ?>
		<br /><?php echo $this->_tpl_vars['lg']['A_source']; ?>
 <br /> <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/smarty_checkbox.sm', 'smarty_include_vars' => array('id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['comboId'],'items' => $this->_tpl_vars['comboTables'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['item']['type'] == '12'): ?>
		<br />Подключаемая таблица <br /> <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/extra_table.sm', 'smarty_include_vars' => array('id_' => $this->_tpl_vars['item']['id'],'name' => $this->_tpl_vars['item']['field'],'selected' => $this->_tpl_vars['item']['combo'],'items' => $this->_tpl_vars['comboTables'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php endif; ?>
                <div id='validateOptions_<?php echo $this->_foreach['ord']['iteration']; ?>
' style="display:none">
        Валидатор: <select id='setValidator_<?php echo $this->_foreach['ord']['iteration']; ?>
'><option value="0"></option><?php $_from = $this->_tpl_vars['validFunc']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['b']):
?><option value="<?php echo $this->_tpl_vars['b']['id']; ?>
" <?php if ($this->_tpl_vars['b']['id'] == $this->_tpl_vars['item']['validator']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['b']['c_name']; ?>
</option><?php endforeach; endif; unset($_from); ?></select> <br>
        Обязательно для заполнения: <input type='checkbox' id='setRequired_<?php echo $this->_foreach['ord']['iteration']; ?>
' <?php if ($this->_tpl_vars['item']['required'] == 1): ?>checked<?php endif; ?>><br>
        Минимальная длина: <input type='edit' id='minlength_<?php echo $this->_foreach['ord']['iteration']; ?>
' value="<?php echo $this->_tpl_vars['item']['minlength']; ?>
"><br>
        Максимальная длина: <input type='edit' id='maxlength_<?php echo $this->_foreach['ord']['iteration']; ?>
' value="<?php echo $this->_tpl_vars['item']['maxlength']; ?>
"><br>
        Уникальное поле: <input type='checkbox' id='setUnique_<?php echo $this->_foreach['ord']['iteration']; ?>
' <?php if ($this->_tpl_vars['item']['uniqueFld'] == 1): ?>checked<?php endif; ?>><br>
        <input type="button" value="save" id='setVld' onclick="updateValidFuncs(<?php echo $this->_tpl_vars['item']['id']; ?>
,document.getElementById('setValidator_<?php echo $this->_foreach['ord']['iteration']; ?>
').options[document.getElementById('setValidator_<?php echo $this->_foreach['ord']['iteration']; ?>
').selectedIndex].value,$('#setRequired_<?php echo $this->_foreach['ord']['iteration']; ?>
').attr('checked'),$('#minlength_<?php echo $this->_foreach['ord']['iteration']; ?>
').val(),$('#maxlength_<?php echo $this->_foreach['ord']['iteration']; ?>
').val(),$('#setUnique_<?php echo $this->_foreach['ord']['iteration']; ?>
').attr('checked'))">
        </div>
        <a href=# onclick="document.getElementById('validateOptions_<?php echo $this->_foreach['ord']['iteration']; ?>
').style.display='block'">Настройки валидации</a>
      </td>
      <td align="center" >&nbsp;<span style="cursor:help" title="Изменить значение по умолчанию" onclick="alertAlias('<?php echo $this->_tpl_vars['item']['id']; ?>
','<?php echo $this->_tpl_vars['item']['def_value']; ?>
', 'def_value')"><?php if ($this->_tpl_vars['item']['def_value']): ?><?php echo $this->_tpl_vars['item']['def_value']; ?>
<?php else: ?>[&nbsp;&nbsp;&nbsp;]<?php endif; ?></span></td>
    </tr>
  <?php endforeach; endif; unset($_from); ?>
  <?php else: ?>
    <?php echo $this->_tpl_vars['lg']['A_noData']; ?>

  <?php endif; ?>
  <tr>
    <td colspan="4" align="center"><b><?php echo $this->_tpl_vars['lg']['A_add']; ?>
</b></td>
  </tr>
  <tr>
    <td colspan="3"><?php echo $this->_tpl_vars['lg']['A_alias']; ?>
</td>
    <td><input id='field_alias' type="text"/></td>
  </tr>
  <tr>
    <td colspan="3"><?php echo $this->_tpl_vars['lg']['A_nameInDb']; ?>
</td>
    <td><input id='field_name' type="text"/></td>
  </tr>
  <tr>
    <td colspan="3"><?php echo $this->_tpl_vars['lg']['A_fieldType']; ?>
</td>
    <td>
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'bsm/select.sm', 'smarty_include_vars' => array('id' => 'field_type','items' => $this->_tpl_vars['fieldTypes'])));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    </td>
  </tr>
  <tr>
    <td colspan="3">Значение по умолчанию<br><font size="1">Например "Вася" или "~%CURTIME()" для SQL функций.</font></td>
    <td>
      <input id='field_default' type="text"/>
    </td>
  </tr>
  <tr>
    <td colspan="4" align="center"><input type="button"
    onclick=ajaz("page=newField&table=<?php echo $_POST['table']; ?>
&field_alias="+document.getElementById("field_alias").value+"&field_default="+document.getElementById("field_default").value+"&field_name="+document.getElementById("field_name").value+"&field_type="+document.getElementById("field_type").value) value="<?php echo $this->_tpl_vars['lg']['A_add']; ?>
" /></td>
  </tr>
</table>